<template>
  <header>
    <h1>探索Vue3与leaflet结合</h1>
    <nav>
      <ul>
        <li>
          <RouterLink to="/map">首页</RouterLink>
        </li>
        <li>
          <RouterLink to="/LargeScreen">数据大屏</RouterLink>
        </li>
      </ul>
    </nav>
  </header>
  <main>
    <RouterView></RouterView>
  </main>

</template>

<script setup lang="ts" name="App">
import { RouterLink, RouterView } from 'vue-router'

</script>

<style scoped>
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

#app {
  width: 100%;
  height: 100%;
}

header {
  background: linear-gradient(90deg, #ca2a2a, #8b0a0a);
  /* 渐变背景 */
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* 添加阴影 */
  max-height: 75px;
  z-index: 100;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  /* 增大标题字体 */
  letter-spacing: 2px;
  /* 字母间距 */
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  margin: 0;
  padding: 0;
}

nav ul li {
  list-style: none;
  margin-right: 20px;
}

nav ul li:last-child {
  margin-right: 0;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  /* 平滑过渡效果 */
  position: relative;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: white;
  transition: width 0.3s;
}

nav ul li a:hover::after {
  width: 100%;
}

nav ul li a:hover {
  color: #f7d794;
  /* 悬停时改变链接颜色 */
}

main {
  width: 100%;
  height: calc(100% - 75px);
  z-index: 1;
}
</style>
